<script>
    defaultParams.id = "notesApplet";
    var loadedFromStorage = false;

    function ggbAppletOnLoad(id){
        window.parent.postMessage("{\"action\":\"appletOnLoad\"}","*");
        if (loadedFromStorage && id == defaultParams.id) {
            window[defaultParams.id].setSaved(false);
        }
    }

    function loadFontScript(basePath) {
        var app = document.createElement("script");
        app.setAttribute("src", basePath + "/js/webfont.js");
        document.head.appendChild(app);
    }

    function loadUnsavedWork(ggw) {
        var storage = window.sessionStorage;
        var unsavedWork = storage.getItem('tafelUnsaved');

        if (unsavedWork) {
            loadBase64(ggw, unsavedWork);
            storage.removeItem('tafelUnsaved')
            loadedFromStorage = true;
        }
        return unsavedWork;
    }

    function loadBase64(ggw, base64){
        ggw.setAttribute("data-param-ggbBase64", base64);
        if(window.addAppletPreview){
            window.addAppletPreview(base64);
        }
        perspective(false);
        insertScript();
    }

    function toggleFullscreen() {
        try {
            // the CSS class is defined in https://git.geogebra.org/mow/mow-front/blob/master/app.php
            window.parent.$(window.parent.document.body).toggleClass(
                "fullscreen-app");
        } catch (ex) {
            // possibly the Mebis iframe is embedded in some non-standard page
            window.console.log(ex);
        }
    }

    function nativeLogin() {
        try {
            if (window.parent && window.parent.login) {
                window.parent.login();
                return true;
            }
            return false;
        } catch (ex) {
            //running in CORS iframe
        }
        return false;
    }

    function ggbMultiplayerChange(users) {
       window.parent && window.parent.multiplayerChange && window.parent.multiplayerChange(users);
    }

    function isEmbed() {
        return false;
    }
</script>
<style>
body {
  --ggb-primary-color: #00a8d5;
  --ggb-primary-variant-color: #0079a3;
  --ggb-dark-color: #0079a3;
  --ggb-light-color: #b7e4f1;
  --ggb-selection-color: #00a8d533;
}
</style>